import 'package:flutter/material.dart';

/**
 * 输入框，具体属性参考图片
 */
class TExtFieldWidget extends StatelessWidget {
  const TExtFieldWidget({super.key});

  @override
  Widget build(BuildContext context) {
    var c1 = TextEditingController();

    return Scaffold(
      appBar: AppBar(
        title: Text('输入框 TextField'),
        backgroundColor: Color(0xffff0000),
      ),
      body: Column(
        children: [
          TextField(
            controller: c1,
            obscureText: true,
            keyboardType: TextInputType.number,
            // maxLines: 3,

            ///最大和最小的输入行数（不支持enter换行）
            // minLines: 1,
          ),
          ElevatedButton(
            onPressed: () {
              print(c1.text);
            },
            child: Text('Click me'),
          )
        ],
      ),
    );
  }
}
